function buyerTableChoice() {
    $.ajax({
        type: "GET",
        contentType: "application/json;charset=UTF-8",
        url: "/table/tableJson",
        //数据，json字符串
        //请求成功
        success: function (result) {
            trHTML = "";
            $.each(result, function(lineNumber, rowdata) {
                if (rowdata.state==1){
                    $("#table"+rowdata.id).css("background-image","url(../images/11.jpg)");
                }else if(rowdata.state==-1){
                    $("#table"+rowdata.id).css("background-image","url(../images/10.jpg)");
                    $("#table"+rowdata.id+" >a").attr("href","javascript:void()");
                    $("#table"+rowdata.id+" >button").attr("disabled",true);
                }
                // trHTML = trHTML +
                //     "<tr><td>"+rowdata.id+
                //     "</td><td>"+rowdata.foodname+
                //     "</td><td>"+rowdata.foodprice+
                //     "</td><td>"+pass+
                //     "</td><td><a href='/cart/addCart/"+rowdata.id+"'>添加到购物车</a>" +
                //     "</td></tr>";
            });
            $('table').append(trHTML);
        },
        //请求失败，包含具体的错误信息
        error: function (e) {
            console.log(e.status);
            console.log(e.responseText);
        }
    });
}